package org.finesys.test.oauth2;

import org.finesys.system.SystemApplication;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SystemApplication.class)
public class Oauth2RedisDes {

    @Resource
    RedisTemplate redisTemplate;

    @Test
    public void des() {
        String token = "token::access_token::9e200a32-540b-4a8e-bef9-0f01a94a4839";
//        Object value = (String) redisTemplate.opsForValue().get(token);
//        System.out.println(value.toString());
        redisTemplate.setValueSerializer(RedisSerializer.java());
        Object object = redisTemplate.opsForValue().get(token);
        System.out.println(object.toString());
    }

}
